import React, { Component } from 'react'
import axios from 'axios';

export default class Proxy extends Component {
    render() {
        return (
            <div>
                <a href="/abc">测试连接</a>
                <img src="/image/logo.png" alt="" />
                <button onClick={this.getStu}>获取学生信息</button>
                <button onClick={this.getCar}>获取汽车信息</button>
                <button onClick={this.getZhihu}>获取知乎热榜数据</button>
                <button onClick={this.getHotMovies}>获取热映电影</button>
            </div>
        )
    }

    //获取热映电影
    getHotMovies = async () => {
        let result = await axios('/meituan/ptapi/getHotFilms?ci=76&limit=10')
        console.log(result);
    }

    //获取知乎热榜
    getZhihu = async () => {
        let result = await axios('/zhihu/api/v3/feed/topstory/hot-list-web?limit=50&desktop=true')

        //输出结果
        console.log(result);
    }


    getStu = async () => {
        let result = await axios('/students');// 5000
        console.log(result.data);
    }

    getCar = async () => {
        let result = await axios('/cars');
        console.log(result);
    }
}
